package day17.zhiyou100;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;

// 字节输出缓冲流
public class Demo06_BufferedOutputStream {


    //

    public static void m1() throws Exception {
        // 往指定文件写一个字节数据
        File file = new File("D:\\aa\\bb\\buffer1.txt");
        FileOutputStream fos = new FileOutputStream(file);
        // 准备缓冲流对象BufferedOutputStream
        BufferedOutputStream bos = new BufferedOutputStream(fos,2);// buf.length =2
        byte[] bytes = {65,66,67};
        bos.write(bytes);
        // 刷新
        bos.flush();
        bos.close();
        fos.close();
    }

    public static void main(String[] args) throws Exception{
        m1();
    }
}
